package cn.bugstack.mybatis.session;

import cn.bugstack.mybatis.builder.xml.XmlConfigBuilder;
import cn.bugstack.mybatis.session.defaults.DefaultSqlSessionFactory;

import java.io.Reader;

public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build(Reader reader) throws Exception {
        XmlConfigBuilder xmlConfigBuilder = new XmlConfigBuilder(reader);
        Configuration configuration = xmlConfigBuilder.parse();
        return new DefaultSqlSessionFactory(configuration);
    }
}
